package xrc.service;

import com.alibaba.fastjson.JSONObject;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;
import xrc.domain.Event;
import xrc.domain.User;


import java.sql.SQLException;
import java.text.ParseException;
import java.util.List;

/*用户模块业务层接口*/
public interface UserService {

    //注册功能 用户名以及密码
    List<Object> register(JSONObject user) throws ClassNotFoundException, SQLException;

    //登录功能
    List<Object> login(JSONObject user);

    //获取数据库事项表内容
    List<Object> getWaitForVoteList(JSONObject user) throws Exception;

    //用户发起一项投票
    List<Object> publish(JSONObject event) throws Exception;

    //获取用户发起的投票事项的列表
    List<Object> getPublishedVoteList(JSONObject event) throws ClassNotFoundException, SQLException, ParseException;

    //预投票：
    //用户提交秘钥，计算该用户的A、C值及该用户对其他参与者的秘密值
    List<Object> preVote(JSONObject user) throws Exception;

    //对A，C以及秘密值进行验证
    List<Object> verify(JSONObject user) throws Exception;

    //获取系统中所有用户
    List<Object> allUser(JSONObject user) throws ClassNotFoundException, SQLException;

    //用户对某一投票事项进行投票
    List<Object> vote(JSONObject user) throws Exception;

    //预计票：
    //用户提交秘钥，用其秘钥加密g^R
    List<Object> preCount(JSONObject user) throws Exception;

    //修改密码
    List<Object> modify(JSONObject user);

    //获取总票数
    List<Object> getSum(JSONObject user) throws Exception;

    String hello();

    Integer findId(String name);

    List<Object> addY(JSONObject user) throws Exception;

    List<Object> addE(JSONObject user) throws Exception;

    List<Object> Sum(JSONObject user) throws Exception;


}
